#pragma once

#include <QObject>
#include <QWidget>
#include "ZHConvertUtils.h"

class QsciScintilla;

class ZhConvertClass : public QObject
{
	Q_OBJECT

public:
	explicit ZhConvertClass(QObject* parent, QWidget* pNotepad);
	~ZhConvertClass();

public:
	void on_TraToSimple();
	void on_SimpletoTra();
	void on_OpenTradFix();
	void on_ChangeFix();

private:
	void setScintText(const QString& text, bool isSelection);
	QString getCurrentText(bool& isSelection);


private:
	std::function<QsciScintilla* ()> scintillaCallback_;
	QString  intext_;
	NodeList* correctionTable_ = nullptr;
	QWidget* m_pNotepad;
	QWidget* mainWidget_;
};
